package com.zh.file.service;

import com.zh.common.bean.Result;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Description:
 * @ClassName UploadFileService
 * @date: 2020.12.10 19:26
 * @Author: zhanghang
 */
public interface UploadFileService {

    /**
     * 上传文件到fastdfs图片服务器
     *
     * @param
     * @return
     */
    Result<String> uploadFilesToServer(MultipartFile[] files, String fileType, String fileTypeCode) throws Exception;

    /**
     * 从fastdfs服务器下载文件
     *
     * @param filesName
     * @param filesPath
     */
    void downloadFile(String filesName, String filesPath, HttpServletResponse response) throws IOException;

    /**
     * 根据业务id删除附件
     *
     * @return
     */
    void deleteFile(Long id) throws Exception;
}
